﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="allindex.aspx.cs" Inherits="KSGJ.allindex" %>
<%@ Register Assembly="AspNetPager" Namespace="Wuqi.Webdiyer" TagPrefix="webdiyer" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <meta http-equiv="X-UA-Compatible" content="ie=9;ie=8" />
    <title>全网折扣</title>
    <script src="/ksgj/Scripts/jquery.min.js" type="text/javascript"></script>
    <script src="/ksgj/Scripts/jquery.loadthumb.js" type="text/javascript"></script>
    <script src="/ksgj/Scripts/AlertBox/jquery.artDialog.js?skin=blue" type="text/javascript"></script>
    <script src="/ksgj/Scripts/DatePicker/WdatePicker.js" type="text/javascript"></script>
    <script src="/ksgj/Scripts/jquery.smartWizard.min.js" type="text/javascript"></script>
    <link href="/ksgj/css/MainSet.css" rel="stylesheet" type="text/css" />
    <link href="/ksgj/css/Header_Nav.css" rel="stylesheet" type="text/css" />
    <link href="/ksgj/css/sidebar.css" rel="stylesheet" type="text/css" />
    <link href="/ksgj/css/From_Effect.css" rel="stylesheet" type="text/css" />
    <link href="/ksgj/css/btn.css" rel="stylesheet" type="text/css" />
    <link href="/ksgj/css/smart_wizard.css" rel="stylesheet" type="text/css" />
<%--    <script src="/Scripts/jquery.min.js" type="text/javascript"></script>
    <script src="/Scripts/jquery.loadthumb.js" type="text/javascript"></script>
    <script src="/Scripts/DatePicker/WdatePicker.js" type="text/javascript"></script>
    <script src="/Scripts/AlertBox/jquery.artDialog.js?skin=blue" type="text/javascript"></script>
    <script src="Scripts/jquery.smartWizard.min.js" type="text/javascript"></script>
    <link href="/css/MainSet.css" rel="stylesheet" type="text/css" />
    <link href="/css/Header_Nav.css" rel="stylesheet" type="text/css" />
    <link href="/css/sidebar.css" rel="stylesheet" type="text/css" />
    <link href="/css/From_Effect.css" rel="stylesheet" type="text/css" />
    <link href="/css/btn.css" rel="stylesheet" type="text/css" />
    <link href="/css/smart_wizard.css" rel="stylesheet" type="text/css" />--%>
    <style type="text/css" media="screen">
        #AspNetPager a{text-decoration:none;}
        a{text-decoration:none;}
        a:hover{text-decoration:none;}
    </style>
    <script type="text/javascript" language="javascript">
        function resizeImg() {
            var imgcount = $(".imgdiv img").length;
            for (var i = 0; i < imgcount; i++) {
                $($(".imgdiv img")[i]).loadthumb({
                    "src": $(".imgdiv img")[i].src,
                    "imgId": $(".imgdiv img")[i].id,
                    "parentId": $($(".imgdiv img")[i]).parent()[0].id
                });
            }
        }
        function onloadfun() {
            $("#AspNetPager a[disabled|=disabled]").addClass("paginate_button_disabled");
            $("a.btn").wrapInner("<span></span>");
            $("a.btn, button, .pager img").hover(function () {
                $(this).stop().fadeTo(200, 0.7);
            }, function () {
                $(this).stop().fadeTo(200, 1.0);
            });
            $("ul.gallery li").hover(function () {
                $(this).css("border-color", "#E6C26E");
                $(this).css("box-shadow", "0 0 2px #E6C26E");
            }, function () {
                $(this).css("border-color", "#c0c0c0");
                $(this).css("box-shadow", "0 0 2px rgba(0,0,0,0.25)");
            });
            $("#promotionsteps").smartWizard({
                selected: 0,
                labelNext:'下一步',
                labelPrevious: '上一步',
                labelFinish: '完成',
                onFinish: finishCallback,
                onLeaveStep: leaveAStepCallback
            });
        }
        function selectchange(obj) {
            if ($(obj).val() == 0) {
                $(obj).parent().parent().next().children("td").eq(1).children("span").text("元");
            }
            else {
                $(obj).parent().parent().next().children("td").eq(1).children("span").text("折");
            }
        }

        function finishCallback() {
            var temptitle = $("#resulttitle").text();
            var templastid = $("#lastgoodidlist").val().substr(0, $("#lastgoodidlist").val().length - 1);
            var gaijiaprice = $("#promotionprice").val();
            var gaijiatype = $("#promptiontype").val();
            var pricestarttime = $("#resulthts").text();
            var priceovertime = $("#resulthte").text();
            var gaijiadialog = $.dialog({ title: '正在提交...', lock: true, opacity: 0.7, width: 400, height: 150, esc: false, close: function () { $("#reload").click() } });
            $.ajax({
                type: "post",
                url: "/ksgj/AjaxCommand/setallprice.ashx",
                //url: "/AjaxCommand/setallprice.ashx",
                data: {
                    title: temptitle,
                    price: gaijiaprice,
                    starttime: pricestarttime,
                    goodid: templastid,
                    overtime: priceovertime,
                    gajiatype: gaijiatype
                },
                beforeSend: function (XMLHttpRequest) {
                    $("a.aui_close").hide();
                    gaijiadialog.content("<h3 style='color:#205A94'>正在添加优惠活动,请稍后...<img src='img/loading.gif' alt='' /></h3><p style='color:#205A94'>请不要刷新或关闭页面!</p>");
                },
                success: function (data, textStatus, jqXHR) {
                    if (data == "ok") {
                        gaijiadialog.title("成功");
                        gaijiadialog.content("<h3 style='color:#205A94'>优惠活动创建成功!</h3>");
                        gaijiadialog.size(400, 94);
                        gaijiadialog.button({ name: '确定', focus: true });
                    }
                    else {
                        gaijiadialog.title("失败");
                        gaijiadialog.content("<p style='color:#205A94'>" + data + "</p>");
                        gaijiadialog.size(400, 94);
                        gaijiadialog.button({ name: '确定', focus: true });
                    }
                },
                complete: function (XMLHttpRequest, textStatus) {
                    $("a.aui_close").show();
                },
                error: function (XMLHttpRequest, textStatus, errorThrown) {
                    // 通常 textStatus 和 errorThrown 之中
                    // 只有一个会包含信息
                    //alert(XMLHttpRequest); // 调用本次AJAX请求时传递的options参数
                    gaijiadialog.title("错误");
                    gaijiadialog.content("<p style='color:#205A94'>创建活动出错，请稍后再试！</p>");
                    gaijiadialog.size(400, 94);
                    gaijiadialog.button({ name: '确定', focus: true });
                }
            });
        }

        function leaveAStepCallback(obj,nobj) {
            var step_num = nobj.attr('rel');
            var cstep_num = obj.attr('rel');
            var sdt = new Date($("#hts").val().replace(/-/g, "/"));
            var edt = new Date($("#hte").val().replace(/-/g, "/"));
            var remoney = /^(([1-9]\d*)|0)(\.\d{1,2})?$/;
            var specialreg = /^[a-zA-Z0-9\u4e00-\u9fa5]+$/;
            if (step_num == "2" && cstep_num == "1") {
                if ($("#promotiontitle").val() == "") {
                    msgalet("请输入活动名称");
                    return false;
                }
                else if ($("#promotiontitle").val().length > 5) {
                    msgalet("活动名称不能超过5个字符");
                    return false;
                }
                else if (!specialreg.test($("#promotiontitle").val())) {
                    msgalet("活动名称不能包含特殊字符");
                    return false;
                }
                if ($("#hts").val() == "" || $("#hte").val() == "") {
                    msgalet("请输入活动开始日期或结束日期");
                    return false;
                }
                else if (sdt > edt) {
                    msgalet("活动开始日期不能大于活动结束日期");
                    return false;
                }
                if (!remoney.test($("#promotionprice").val())) {
                    msgalet("请正确填写优惠额度，比如：8.63");
                    return false;
                }
                else if ($("#promptiontype").val() == "1") {
                    if ($("#promotionprice").val() > 10 || $("#promotionprice").val() < 7) {
                        msgalet("请正确填写优惠额度，范围在9.9到7.0之间");
                        return false;
                    }
                }
                $("#goodload").show();
                $("#promotiongoodlist").height(0);
                $("#promotiongoodlist").attr("src", "PromotionCreate.aspx?ptype=" + $("#promptiontype").val() + "&pvalue=" + $("#promotionprice").val());
            }
            if (step_num == "1" && cstep_num == "2") {
                $("#promotiongoodlist").hide();
            }
            if (step_num == "3") {
                $("#PromotionIdlist").val($("#promotiongoodlist").contents().find("#goodslist").val());
                if ($("#PromotionIdlist").val() == "") {
                    msgalet("请选择参与活动的宝贝");
                    return false;
                }
                else {
                    $("#lastgoodidlist").val("");
                    $("#resulttitle").text($("#promotiontitle").val());
                    $("#resulthts").text($("#hts").val());
                    $("#resulthte").text($("#hte").val());
                    var morz = $("#promptiontype").val() == 0 ? "元" : "折";
                    $("#resultmoney").text($("#promotionprice").val() + morz);
                    $("#resultidlist").html(function () {
                        var gidlist = $("#PromotionIdlist").val().substr(0, $("#PromotionIdlist").val().length - 1);
                        var tempgidlist = gidlist.split(",");
                        var hascount = 0;
                        var sscount = 0;
                        $.each(tempgidlist, function (index, value) {
                            var tempgood = value.split("|");
                            if (tempgood.length > 1) {
                                if (tempgood[1] == "1") {
                                    hascount += 1;
                                }
                                else if (tempgood[1] == "0") {
                                    sscount += 1;
                                }
                            }
                            else {
                                $("#lastgoodidlist").val(function (index, hvalue) {
                                    return hvalue + tempgood + ",";
                                })
                            }
                        });
                        var okcount = tempgidlist.length - hascount - sscount;
                        var totlecount = tempgidlist.length;
                        var resultmsg = "<p>共选择了" + totlecount + "件宝贝</p><p>有效宝贝：" + okcount + "件</p><p>已存在优惠活动的宝贝：" + hascount + "件</p><p>优惠后价格小于原价7折的宝贝：" + sscount + "件</p><p>只有有效的宝贝才会参与优惠活动</p>";
                        return resultmsg;
                    });
                }
            }
            if (step_num == "1" || step_num == "2") {
                $("a[rel='3']").attr("isdone", "0").addClass("disabled").removeClass("done");
            }
            return true;
        }

//        function getnewprice(obj) {
//            var oldprice = $(obj).parent().siblings(".goodcontent").eq(1).children("span").eq(0).text();
//            var promotiontype = $(obj).parent().siblings(".goodcontent").eq(1).children("select").eq(0).val();
//            if (promotiontype == 0) {
//                $(obj).parent().siblings(".goodcontent").eq(1).children("span").eq(1).text(accMul(oldprice, accMul($(obj).val() == "" ? 10 : $(obj).val(), 0.1)));
//            }
//            else {
//                
//                $(obj).parent().siblings(".goodcontent").eq(1).children("span").eq(1).text(accSubtr(oldprice, $(obj).val()));
//            }
//        }

        function accSubtr(arg1, arg2) {
            var r1, r2, m, n;
            try { r1 = arg1.toString().split(".")[1].length } catch (e) { r1 = 0 }
            try { r2 = arg2.toString().split(".")[1].length } catch (e) { r2 = 0 }
            m = Math.pow(10, Math.max(r1, r2));
            //动态控制精度长度
            n = (r1 >= r2) ? r1 : r2;
            return ((arg1 * m - arg2 * m) / m).toFixed(n);
        }
        function accMul(arg1, arg2) {
            var m = 0, s1 = arg1.toString(), s2 = arg2.toString();
            try { m += s1.split(".")[1].length } catch (e) { }
            try { m += s2.split(".")[1].length } catch (e) { }
            return Number(s1.replace(".", "")) * Number(s2.replace(".", "")) / Math.pow(10, m)
        }

        function chanelpromotion(obj) {
            if (!confirm("是否确定删除该活动?")) {
                return;
            }
            var deleteid = $("#promotionactiveid").val();
            var gaijiadialog = $.dialog({ title: '正在删除...', lock: true, opacity: 0.7, width: 400, height: 150, esc: false, close: function () { $("#reload").click() } });
            $.ajax({
                type: "post",
                url: "/ksgj/AjaxCommand/chanelpromotion.ashx",
                //url: "/AjaxCommand/chanelpromotion.ashx",
                data: {
                    Did: deleteid
                },
                beforeSend: function (XMLHttpRequest) {
                    $("a.aui_close").hide();
                    gaijiadialog.content("<h3 style='color:#205A94'>正在删除优惠活动,请稍后...<img src='img/loading.gif' alt='' /></h3><p style='color:#205A94'>请不要刷新或关闭页面!</p>");
                },
                success: function (data, textStatus, jqXHR) {
                    if (data == "ok") {
                        gaijiadialog.title("成功");
                        gaijiadialog.content("<h3 style='color:#205A94'>优惠活动删除成功!</h3>");
                        gaijiadialog.size(400, 94);
                        gaijiadialog.button({ name: '确定', focus: true });
                        $(obj).parent().parent().remove();
                    }
                    else {
                        gaijiadialog.title("失败");
                        gaijiadialog.content("<p style='color:#205A94'>" + data + "</p>");
                        gaijiadialog.size(400, 94);
                        gaijiadialog.button({ name: '确定', focus: true });
                    }
                },
                complete: function (XMLHttpRequest, textStatus) {
                    $("a.aui_close").show();
                },
                error: function (XMLHttpRequest, textStatus, errorThrown) {
                    // 通常 textStatus 和 errorThrown 之中
                    // 只有一个会包含信息
                    //alert(XMLHttpRequest); // 调用本次AJAX请求时传递的options参数
                    gaijiadialog.title("错误");
                    gaijiadialog.content("<p style='color:#205A94'>删除优惠活动失败，请稍后再试！</p>");
                    gaijiadialog.size(400, 94);
                    gaijiadialog.button({ name: '确定', focus: true });
                }
            });
        }
        function createpromotion() {
            $("#promotiontips").hide();
            $("#promotionsteps").show();
        }
        function msgalet(contstr) {
            $.dialog({
                id: 'msgdialog',
                content: contstr,
                icon: 'warning',
                init: function () {
                    var that = this, i = 3;
                    var fn = function () {
                        that.title("提示(" + i + '秒后关闭)');
                        !i && that.close();
                        i--;
                    };
                    timer = setInterval(fn, 1000);
                    fn();
                },
                close: function () {
                    clearInterval(timer);
                }
            });
        }
    </script>
</head>
<body>
    <form id="form1" runat="server">
    <asp:ScriptManager ID="ScriptManager1" runat="server">
    </asp:ScriptManager>
    <asp:HiddenField ID="PromotionIdlist" runat="server" />
    <div id="height-wrapper">
        <div>
            <div id="header_toolbar">
                <div class="container_12">
                    <h1>
                        <span>快速改价</span>&nbsp;&nbsp;&nbsp;&nbsp;
			            <span><a style="color:#CCC" href="http://bangpai.taobao.com/group/thread/14509393-268697663.htm" title="帮助" target="_blank">需要帮助点我吧</a></span>
                        <span style="font-size:14px;float:right;">
                            请使用以下浏览器获得最佳浏览效果:
                            <a target="_blank" title="谷歌浏览器" href="http://www.google.cn/chrome/intl/zh-CN/landing_chrome.html?hl=zh_cn&brand=CHMA&utm_campaign=zh_cn&utm_source=zh_cn-ha-apac-zh_cn-bk&utm_medium=ha">
                                <img src="img/browsers/Chrome.png" alt="chrome" class="browsersimg" />
                            </a>
                            <a target="_blank" title="遨游3浏览器" href="http://www.maxthon.cn/mx3/">
                                <img src="img/browsers/Maxthon.png" alt="maxthon" class="browsersimg" />
                            </a>
                            <a target="_blank" title="火狐浏览器" href="http://firefox.com.cn/download/">
                                <img src="img/browsers/Firefox.png" alt="firefox" class="browsersimg" />
                            </a>
                            <a target="_blank" title="IE8浏览器" href="http://windows.microsoft.com/zh-CN/internet-explorer/downloads/ie-8">
                                <img src="img/browsers/IE.png" alt="ie" class="browsersimg" />
                            </a>
                            <a target="_blank" title="腾讯TT浏览器" href="http://tt.qq.com/">
                                <img src="img/browsers/Traveler.png" alt="traveler" class="browsersimg" />
                            </a>
                            <a target="_blank" title="360极速浏览器" href="http://chrome.360.cn/">
                                <img src="img/browsers/360jisu.png" alt="traveler" class="browsersimg" />
                            </a>
                        </span>
                    </h1>
                </div>
            </div>
            <div id="header_main">
                <div class="container_12">
                    <ul id="nav_main">
                        <li>
                            <a href="Index.aspx">
                                <img src="img/icons/25x25/blue/computer-imac.png" width="25" height="25" alt="" />
                                单人改价
                            </a>
                        </li>
                        <li class="current">
                            <a href="allindex.aspx">
                                <img src="img/icons/25x25/blue/blocks---images.png" width="25" height="25" alt="" />
                                全网折扣
                            </a>
                            <ul>
                                <li>
                                    <span>针对全网买家设置商品折扣或优惠价格,对淘宝网所有买家生效.</span>
                                </li>
                            </ul>
                        </li>
                    </ul>
                </div>
            </div>
            <div id="nav_sub"></div>
        </div>
        <div class="container_12">
            <asp:UpdatePanel ID="contentwrapper" runat="server">
                <ContentTemplate>
                    <asp:Button ID="reload" runat="server" Text="重载" style="display:none;" 
                        onclick="reload_Click" />
                    <div id="aside">
                        <div id="sidebar_top">
                            <div class="userinfo"> 
                                <div class="info"> 
                                    <div class="avatar"> 
                                        <img src="img/sprites/userinfo/avatar.png" width="80" height="80" alt=""> 
                                    </div> 
                                    <a href="order.htm">我要续费</a> 
                                </div> 
                                <ul class="links"> 
                                    <li> 
                                        <strong>
                                            <asp:Label ID="username" runat="server" Text=""></asp:Label>
                                        </strong> 
                                    </li> 
                                    <li> 
                                        <asp:LinkButton ID="closewindow" runat="server" onclick="closewindow_Click" OnClientClick="return confirm('是否需要退出[快速改价]?');">退出</asp:LinkButton>
                                    </li> 
                                    <li>
                                        <asp:LinkButton ID="createpromotion" runat="server" 
                                            onclick="createpromotion_Click">创建新活动</asp:LinkButton>
                                        <%--<a onclick="createpromotion()">创建新活动</a>--%>
                                    </li>
                                </ul> 
                                <div class="clearfix">
                                </div>
                            </div>
                        </div>
                        <div id="sidebar_content" >
                            <asp:TreeView ID="cateTree" runat="server" style="margin:20px auto;" 
                                NodeIndent="20" ShowExpandCollapse="true" class="sidetree" 
                                ForeColor="#4D4D4D" onselectednodechanged="cateTree_SelectedNodeChanged">
                                <SelectedNodeStyle Font-Underline="False" ForeColor="White" 
                                    HorizontalPadding="0px" VerticalPadding="0px" BackColor="#375B91" />
                            </asp:TreeView>

                            <asp:HiddenField ID="promotionactiveid" runat="server" />
                        </div>
                    </div>
                    <div id="main_content">
                        <div class="box" style="position:relative;margin:0;">
                            <div class="header">
                                <img src="img/icons/16x16/list.png" width="16" height="16" alt="" />
                                <h3>宝贝列表</h3>
                            </div>
                            <div class="content">
                                <asp:Panel ID="promotiontips" runat="server" Height="300px" style="text-align:center;">
                                    <p><strong style="color:#547EAB">请在左边选择您已创建的活动，查看参与活动的宝贝</strong></p>
                                    <p><strong style="color:#547EAB">如果您需要创建新活动，可以点击&nbsp;&nbsp;&nbsp;<a class="btn blue" onclick="createpromotion()" style="vertical-align:text-top;">创建新活动</a></strong></p>
                                </asp:Panel>
                                <div id="promotionsteps" class="swMain hiddenpanel">
                                    <ul>
                                        <li>
                                            <a href="#step-1">
                                                <label class="stepNumber">1</label>
                                                <span class="stepDesc">
                                                   定义活动信息<br />
                                                   <small>填写活动基本信息</small>
                                                </span>
                                            </a>
                                        </li>
                                        <li>
                                            <a href="#step-2">
                                                <label class="stepNumber">2</label>
                                                <span class="stepDesc">
                                                   选择活动宝贝<br />
                                                   <small>选择参与活动的宝贝</small>
                                                </span>
                                            </a>
                                        </li>
                                        <li>
                                            <a href="#step-3">
                                                <label class="stepNumber">3</label>
                                                <span class="stepDesc">
                                                   确认活动并发布<br />
                                                   <small>确认无误后发布</small>
                                                </span>
                                            </a>
                                        </li>
                                    </ul>
                                    <div id="step-1">   
                                        <h3 class="StepTitle">填写活动基本信息</h3>
                                        <div style="padding:10px;">
                                            <table cellpadding="0" cellspacing="0" style="margin:0 auto;width:80%">
                                                <tbody>
                                                    <tr>
                                                        <td style="vertical-align:middle">活动名称</td>
                                                        <td style="vertical-align:middle"><input id="promotiontitle" type="text" maxlength="5" style="width:200px;" /></td>
                                                        <td style="vertical-align:middle">最多输入5个字</td>
                                                    </tr>
                                                    <tr>
                                                        <td style="vertical-align:middle">活动开始日期</td>
                                                        <td style="vertical-align:middle"><input type="text" id="hts" style="width:200px;" onfocus="WdatePicker({minDate:'%y-%M-{%d}',maxDate:'#F{$dp.$D(\'hte\',{d:0});}',dateFmt:'yyyy-MM-dd',autoPickDate:true})" /></td>
                                                        <td style="vertical-align:middle"></td>
                                                    </tr>
                                                    <tr>
                                                        <td style="vertical-align:middle">活动结束日期</td>
                                                        <td style="vertical-align:middle"><input type="text" style="width:200px;" id="hte" onfocus="WdatePicker({minDate:'#F{$dp.$D(\'hts\',{d:0});}',dateFmt:'yyyy-MM-dd',autoPickDate:true})" /></td>
                                                        <td style="vertical-align:middle"></td>
                                                    </tr>
                                                    <tr>
                                                        <td style="vertical-align:middle">优惠类型</td>
                                                        <td style="vertical-align:middle">
                                                            <select id="promptiontype" onchange="selectchange(this)" style="width:200px;margin:10px 0;">
                                                                <option value="0">金额</option>
                                                                <option value="1">折扣</option>
                                                            </select>
                                                        </td>
                                                        <td style="vertical-align:middle"></td>
                                                    </tr>
                                                    <tr>
                                                        <td style="vertical-align:middle">优惠额度</td>
                                                        <td style="vertical-align:middle">
                                                            <input id="promotionprice" type="text" style="width:200px;display:inline" />&nbsp;&nbsp;&nbsp;<span>元</span>
                                                        </td>
                                                        <td style="vertical-align:middle">请填写金额或折扣</td>
                                                    </tr>
                                                </tbody>
                                            </table>
                                        </div>
                                    </div>
                                    <div id="step-2" style="height:auto;">
                                        <h3 class="StepTitle">选择参与活动的宝贝</h3> 
                                        <div id="goodload" style="text-align:center;height:50px;margin:100px 0;display:none;">
                                            <img src="img/loading.gif" alt="" />
                                        </div>
                                        <iframe name="promotiongoodlist" id="promotiongoodlist" frameborder="0" width="100%" src="" scrolling="no" ></iframe>
                                    </div>                      
                                    <div id="step-3" style="height:auto;">
                                        <h3 class="StepTitle">请仔细确认活动信息</h3>   
                                        <div style="padding:10px;">
                                            <table cellpadding="0" cellspacing="0" style="margin:0 auto;width:80%">
                                                <tbody>
                                                    <tr>
                                                        <td style="vertical-align:middle;height:44px;width:30%">活动名称</td>
                                                        <td style="vertical-align:middle;height:44px;"><span id="resulttitle"></span></td>
                                                    </tr>
                                                    <tr>
                                                        <td style="vertical-align:middle;height:44px;width:30%">活动开始日期</td>
                                                        <td style="vertical-align:middle;height:44px;"><span id="resulthts"></span></td>
                                                    </tr>
                                                    <tr>
                                                        <td style="vertical-align:middle;height:44px;width:30%">活动结束日期</td>
                                                        <td style="vertical-align:middle;height:44px;"><span id="resulthte"></span></td>
                                                    </tr>
                                                    <tr>
                                                        <td style="vertical-align:middle;height:44px;width:30%">优惠额度</td>
                                                        <td style="vertical-align:middle;height:44px;">
                                                            <span id="resultmoney"></span>
                                                        </td>
                                                    </tr>
                                                    <tr>
                                                        <td colspan="2">
                                                            <div id="resultidlist" style="height:150px;"></div>
                                                            <asp:HiddenField ID="lastgoodidlist" runat="server" />
                                                        </td>
                                                    </tr>
                                                </tbody>
                                            </table>
                                        </div>
                                    </div>
                                </div>
                            </div>
                            <asp:Panel ID="promotiondelete" style="position:absolute;top:7px;right:5px;" runat="server" Visible="false">
                                <a class="btn blue" onclick="chanelpromotion()">删除活动</a>
                            </asp:Panel>
                            <%--<div style="position:absolute;top:7px;right:5px;">
                                <asp:TextBox ID="keyword" runat="server" Width="200px" MaxLength="40" style="float:none;display:inline;margin:0"></asp:TextBox>
                                <asp:LinkButton ID="search" runat="server" onclick="search_Click" OnClientClick="return searchgood();" CssClass="btn blue" style="vertical-align:bottom">搜索</asp:LinkButton>
                            </div>--%>
                        </div>
                        <asp:Panel ID="Promotionactives" runat="server" CssClass="grid_12" Visible="false">
                            <div>
                                <ul class="gallery" style="margin:0 0 10px 0;">
                                    <asp:Repeater ID="goodlist" runat="server" 
                                        onitemdatabound="goodlist_ItemDataBound">
                                        <ItemTemplate>
                                            <li style="width:630px;">
                                                <div class="imgdiv" id="imgdiv<%# Eval("Numid") %>" style="width:78px;height:78px;">
                                                    <img id="<%# Eval("Numid") %>" src="<%# Eval("Picurl") %>" alt="" style="display:none" />
                                                </div>
                                                <asp:Panel ID="activepanel" runat="server" style="float:left;width:470px;">
                                                    <div class="goodcontent" style="color:#205A94">
                                                        <%# Eval("GoodTitle").ToString().Trim()%>
                                                        <asp:HiddenField ID="Hiddennid" runat="server" Value='<%# Eval("Numid") %>' />
                                                        <asp:HiddenField ID="Hiddenpid" runat="server" Value='<%# Eval("Pid") %>' />
                                                    </div>
                                                    <div class="goodcontent">
                                                        价格：￥<span><%# Eval("Oldprice")%></span>&nbsp;&nbsp;&nbsp;优惠后价格：￥<span><%# Eval("DiscountType") == "DISCOUNT" ? double.Parse(Eval("Oldprice").ToString()) * (double.Parse(Eval("DiscountValue").ToString()) / 10) : double.Parse(Eval("Oldprice").ToString()) - double.Parse(Eval("DiscountValue").ToString()) %></span>&nbsp;&nbsp;&nbsp;
                                                    </div>
                                                    <div class="goodcontent" style="font-size:12px;">
                                                        开始时间：<span><%# Eval("Startime")%></span>&nbsp;&nbsp;&nbsp;
                                                        结束时间：<span><%# Eval("Endtime")%></span></div>
                                                </asp:Panel>
                                                <div class="clearfix"></div>
                                                <%--<asp:Panel ID="unactivepanel" runat="server" CssClass="hidden" style="float:left;width:505px;">
                                                    <div class="goodcontent">
                                                        <%# Eval("title").ToString().Trim()%>
                                                        <asp:HiddenField ID="HiddenField1" runat="server" Value='<%# Eval("numiid") %>' />
                                                    </div>
                                                    <div class="goodcontent">
                                                        价格：￥<span><%# Eval("price")%></span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;优惠额度：<asp:Label ID="pricelabel" runat="server" Text=""></asp:Label>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="H">已存在全网折扣</span>
                                                    </div>
                                                    <div class="goodcontent">
                                                        开始时间：<asp:Label ID="startlabel" runat="server" Text=""></asp:Label>&nbsp;&nbsp;&nbsp;&nbsp;
                                                        结束时间：<asp:Label ID="endlabel" runat="server" Text=""></asp:Label>
                                                    </div>
                                                    <div class="goodcontent" style="text-align:right;">
                                                        <a class="btn blue" onclick="chanelpromotion(this)">取消优惠活动</a>
                                                        <a class="btn blue" onclick="copyfunc(this)">复制宝贝地址</a>
                                                    </div>
                                                </asp:Panel>--%>
                                            </li>
                                        </ItemTemplate>
                                        <FooterTemplate>
                                            <asp:Label ID="footlabel" runat="server" Text="该活动下没有参与的宝贝，建议删除活动！" CssClass="nocount" Visible='<%# goodlist.Items.Count == 0 %>'></asp:Label>
                                        </FooterTemplate>
                                    </asp:Repeater>
                                </ul>
                            </div>  
                        <div class="grid_12">
                            <webdiyer:aspnetpager id="AspNetPager" runat="server" HorizontalAlign="Center"
                        Width="100%" CustomInfoHTML="共%PageCount%页，当前为第%CurrentPageIndex%页" CustomInfoTextAlign="Left" 
                        Direction="LeftToRight" FirstPageText="首页" LastPageText="尾页" LayoutType="Div" 
                        NextPageText="下一页" PageIndexBoxType="TextBox" PrevPageText="上一页" 
                        ShowPageIndexBox="Never" PageSize="11" ShowNavigationToolTip="True" 
                        EnableTheming="False" NumericButtonCount="6" 
                            CurrentPageButtonPosition="Center" UrlPageIndexName="currpage" 
                            Wrap="False" CurrentPageButtonClass="paginate_active" UrlPaging="False" 
                                    AlwaysShow="False" 
                                    FirstLastButtonsClass="first paginate_button" 
                                    PagingButtonsClass="paginate_button" 
                                    PrevNextButtonsClass="previous paginate_button" 
                                    onpagechanging="AspNetPager_PageChanging"></webdiyer:aspnetpager>
                        </div>   
                        </asp:Panel>           
                    </div>
                </ContentTemplate>
                <Triggers>
                    <asp:AsyncPostBackTrigger ControlID="cateTree" EventName="SelectedNodeChanged" />
                    <asp:AsyncPostBackTrigger ControlID="AspNetPager" EventName="PageChanging" />
                    <asp:AsyncPostBackTrigger ControlID="closewindow" EventName="Click" />
                    <%--<asp:AsyncPostBackTrigger ControlID="search" EventName="Click" />--%>
                    <asp:AsyncPostBackTrigger ControlID="createpromotion" EventName="Click" />
                    <asp:AsyncPostBackTrigger ControlID="reload" EventName="Click" />
                </Triggers>
            </asp:UpdatePanel>
        </div>
    </div>
    <div id="footer">
        <div class="container_12">
            <span>© 2010-2011武汉卓天信息科技有限公司版权所有</span>&nbsp;&nbsp;&nbsp;
            <span>
                客服旺旺:&nbsp;<a target="_blank" href="http://amos.im.alisoft.com/msg.aw?v=2&uid=%E6%AD%A6%E6%B1%89%E5%8D%93%E5%A4%A9%E7%A7%91%E6%8A%80%E6%9C%89%E9%99%90%E5%85%AC%E5%8F%B8&site=cntaobao&s=1&charset=utf-8" ><img border="0" style="vertical-align:middle;" src="http://amos.im.alisoft.com/online.aw?v=2&uid=%E6%AD%A6%E6%B1%89%E5%8D%93%E5%A4%A9%E7%A7%91%E6%8A%80%E6%9C%89%E9%99%90%E5%85%AC%E5%8F%B8&site=cntaobao&s=1&charset=utf-8" alt="有问必答" /></a>
            </span>
            <span>
                客服邮箱:&nbsp;span>
            <span>
                客服邮箱:&nbsp;<span>ex_sky@163.com</span>
            </span>
            <span>
                客服电话:&nbsp;<span>027-82420526</span>&nbsp;<span>18971460801</span>
            </span>
            <span>
                <a href="http://bangpai.taobao.com/group/14509393.htm" target="_blank">进入帮派</a>
            </span>
        </div>
    </div>
    
    </form>
    <%--<script type="text/javascript" src="http://toptrace.taobao.com/assets/getAppKey.js" topappkey="12310450" defer="defer"></script>--%>
</body>
</html>
